//单元格编辑后回调的方法
efgrid_onDataCellSaved = function( grid_id, row_index, col_index, cell_value ) 
{
	  var grid = efgrid.getGridObject( grid_id ); 
	  if( col_index == 1) 
	  { 
		  var info=_getEi();
		  var eiBlock=info.getBlock("cmes.cp.engineering");
		  for(var i=0;i<eiBlock.getRows().length;i++)
		  {
 			  var _value = eiBlock.getCell(i,"fdKeyId");	//主键
			  if(_value==cell_value)
			  {
				
				  var fdDepartmentId = eiBlock.getCell(i,"fdDepartmentId");
				  var fdClass = eiBlock.getCell(i,"fdClass");	// 工程类别
				  var fdMineRockId = eiBlock.getCell(i,"fdMineRockId");	//煤岩类别
				  var fdBoringProcess = eiBlock.getCell(i,"fdBoringProcess");	// 掘进方式
				  var fdRoadwayType = eiBlock.getCell(i,"fdRoadwayType");	// 巷道类型
				  
				  grid.setCellValue(row_index,0,fdDepartmentId,TYPE_DATA);	// 施工单位
				  grid.setCellValue(row_index,2,fdClass,TYPE_DATA);			// 工程类别
				  grid.setCellValue(row_index,3,fdMineRockId,TYPE_DATA);	//  煤岩类别
				  grid.setCellValue(row_index,4,fdBoringProcess,TYPE_DATA);	// 掘进方式			  
//				  grid.setCellValue(row_index,7,fdRoadwayType,TYPE_DATA);	// 巷道类别
				  
				  grid.refreshCell( row_index, 0 , TYPE_DATA );
				  grid.refreshCell( row_index, 2 , TYPE_DATA );
				  grid.refreshCell( row_index, 3 , TYPE_DATA );
				  grid.refreshCell( row_index, 4 , TYPE_DATA );
//				  grid.refreshCell( row_index, 7 , TYPE_DATA );
			  }			  
		  }
	  } 
}
//var ajax_callback = {
//		onSuccess : function(eiInfo) {
//			var grid = efgrid.getGridObject("ef_grid_result");
//			grid.refresh(eiInfo);
//		}, 
//		onFail:function(eMsg)
//		{
//			alert("确认失败，原因："+eMsg);
//		}
//
//}	

button_insert_onclick = function (){
	if (isSelected("ef_grid_result") == 0)return; 
	efgrid.submitForm( "ef_grid_result", "ZM","ZMCH72","insert",true);
}

button_update_onclick = function (){
	if (isSelected("ef_grid_result") == 0)return; 
	efgrid.submitForm( "ef_grid_result", "ZM","ZMCH72","update",true);
}

button_delete_onclick = function (){
	var grid=isSelected("ef_grid_result");
	if (grid == 0)return; 
	EFConfirm('你确认要删除吗?', '确认框', function(r) {
		if(r)efgrid.submitForm( "ef_grid_result", "ZM","ZMCH72","delete",true);
	}); 
}
efgrid_onAjaxSubmitSuccess = function(gridId, service_name, method_name, eiInfo) {
	if(gridId == "ef_grid_result") {

		if (eiInfo.status != -1) {
			var grid = efgrid.getGridObject("ef_grid_result");
			grid.refresh( eiInfo );
//			efgrid.submitInqu( "ef_grid_result", "ZM","ZMCH70","query");
			window.parent.refresh_main_grid();
		}
		else
		{
			submitCallBackEiMsg = eiInfo.msg;
		}
	} else {
		var grid = efgrid.getGridObject(gridId);
		grid.refresh( eiInfo );
	}
};